let promise1 = new Promise((resolve)=>{
    setTimeout(()=>{
        resolve('a');
    },3000);
});
let promise2 = new Promise((resolve,reject)=>{
    setTimeout(()=>{
        resolve('b');
    },2000);
});
let promise3 = new Promise((resolve,reject)=>{
    setTimeout(()=>{
        reject('失败c');
    },1000);
});
let promises = [promise1,promise2,promise3];
let start = Date.now();
/* Promise.all(promises)
.then((values)=>{
    console.log(values);
    console.log((Date.now()-start)/1000+'s');
})
.catch(error=>{
    console.log(error);
}) */


/* Promise.race(promises)
.then((values)=>{
    console.log(values);
    console.log((Date.now()-start)/1000+'s');
})
.catch(error=>{
    console.log(error);
}) */


/* Promise.any(promises)
.then((values)=>{
    console.log(values);
    console.log((Date.now()-start)/1000+'s');
})
.catch(error=>{
    console.log(error);
}) */

Promise.allSettled(promises)
.then((values)=>{
    console.log(values);
    console.log((Date.now()-start)/1000+'s');
})
.catch(error=>{
    console.log(error);
})